<%-- 
    Document   : sachChiTiet
    Created on : May 21, 2013, 9:13:47 PM
    Author     : quannq
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<input class="add_cart" type="hidden" name="add"/>
<div class="mainbox-container">
    <div class="mainbox-body">
        <div class="product-wrap">
            <div id="product-thumb-70630" class="product-thumb">
                <div id="" class="" style="z-index: 99; position: relative; margin: 0px auto; width: 216px; display: block; ">
                    <a style="display: block;" href="#" class ="cloud-zoom" rel="tintOpacity:0.5 ,smoothMove:5,zoomWidth:600,zoomHeight:350, adjustY:-4, adjustX:10">
                        <img src="${pageContext.request.contextPath}/image/sell/${SachId.anhbia}" alt="${SachId.tensach}" width="220" height="350" style="display: block;"/>
                    </a>
                </div>
            </div>
            <div class="product-info">
                <div class="product-title">
                    <h1>${SachId.tensach}</h1>
                    <p class="product-code">Mã:&nbsp;${SachId.masach}</p>
                </div>
                <div class="product-metadata">
                    <span class="author">Tác giả:&nbsp;<a href="">${SachId.tacgia.tentacgia}</a></span>.&nbsp;<br><br>

                    <div id="fb-root"></div>
                    <script>(function(d, s, id) {
                            var js, fjs = d.getElementsByTagName(s)[0];
                            if (d.getElementById(id))
                                return;
                            js = d.createElement(s);
                            js.id = id;
                            js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1";
                            fjs.parentNode.insertBefore(js, fjs);
                        }(document, 'script', 'facebook-jssdk'));</script>
                    <div class="fb-like" data-href="http://localhost:8080/bookshop/view-sach/${SachId.masach}" 
                         data-send="true" data-width="200" data-show-faces="true" 
                         data-font="tahoma"></div>
                </div>
                <div class="product-offers grad-bg">
                    <div class="product-offer">
                        <div class="product-price">
                            <div class="bb-title">${SachId.loaisach.tenloaisach}</div>
                            <div class="bb-pricing">
                                <div class="price">

                                    <span><span id="sec_original_price_70630">${SachId.giabia-(SachId.giabia*SachId.giamgia/100)}</span>&nbsp;VNÐ</span>
                                </div>
                                <c:if test="${SachId.giamgia>0}">
                                    <div class="save">
                                        <span>
                                            <span id="sec_sell_price_72515" class="price">${SachId.giabia}</span>
                                            <span class="price">VNĐ</span>
                                        </span>
                                        (giảm ${SachId.giamgia}%)
                                    </div>
                                </c:if>
                            </div>
                        </div>
                        <%--<sec:authorize  access="hasRole('ROLE_USER')">--%>
                            <div class="product-buy">
                                <div class="p-add-cart">
                                    <c:if test="${SachId.soluong>0}">
                                        <a name="" href="#" class="p-button p-add-to-cart p-button-red cm-submit-link">
                                            <span class="p-button-start">
                                                <span class="p-addcart-icon"></span>Cho vào giỏ hàng
                                            </span>
                                            <span class="p-button-end"></span>
                                        </a>
                                    </c:if>
                                    <c:if test="${SachId.soluong==0}">
                                        <a class="p-button p-button-black">
                                            <span class="p-button-start">Sản phẩm đã hết hàng</span>
                                            <span class="p-button-end"/>
                                        </a>
                                    </c:if>
                                </div>
                                <div class="p-clear"></div>
                                <div class="p-sep"></div>
                            </div>
                        <%--</sec:authorize>--%>
                        <div class="product-information">
                            Giá Bìa:&nbsp;${SachId.giabia}&nbsp;VNĐ.<br>
                            Giảm Giá:&nbsp;${SachId.giamgia}&nbsp;%.<br>
                            ${SachId.loaibia.tenloaibia}.<br>
                            Năm xuất bản:&nbsp;${SachId.namxb}.<a href="#">${SachId.nhaxuatban.tennxb}</a><br>
                            Số trang:&nbsp;${SachId.sotrang}.<br>
                            Kích thước:&nbsp;${SachId.kichthuoc}.<br>
                            Cân nặng:&nbsp;${SachId.cannang}&nbsp;gr.<br>
                        </div>
                        <div class="line-1"></div>
                        <div class="line-2"></div>
                    </div>
                </div>
            </div>
            <div class="cleardiv"></div>
        </div>

        <c:if test="${SachId.noidung!=''}">
            <div class="product-addition-info">
                <h2>Thông tin</h2>
                <div class="grad-bg">
                    <div class="product-commentary-header">
                        <ul class="tabs">
                            <li class="first-item"><a href="">Nội dung</a></li>
                        </ul>
                    </div>
                    <div class="product-commentary product-commentary-first">
                        <h3 id="commentary-content">Nội dung</h3>
                        <div class="wysiwyg">
                            ${SachId.noidung}
                        </div>
                    </div>
                </div>
            </div>
        </c:if>

    </div>
</div>
